package com.ljf.sso;

import java.util.function.BiFunction;

/**
 * 说明：sso处理器，用户自定义验证是否有获取sso登录的权限
 *
 * @Auther: lijinfeng
 * @Date: 2022/12/12
 */
public class SsoHandler {
    /**
     * 客制化验证权限，正确返回APP_ID 错误返回0L
     */
    public BiFunction<String, String, Long> ssoHandler = (u, p) ->{
        return 0L;
    };

    /**
     * 设置SSO登录校验函数
     *
     * @param ssoHandler
     * @return
     */
    public void setSsoHandler(BiFunction<String, String, Long> ssoHandler) {
        this.ssoHandler = ssoHandler;
    }

    /**
     * 获取SSO登录校验函数
     *
     * @return
     */
    public BiFunction<String, String, Long> getSsoHandler() {
        return ssoHandler;
    }

}
